﻿using SuperX.Common.Helper;
using SuperSocket.SocketBase.Command;
using SuperSocket.SocketBase.Protocol;
using System.Text;

namespace SuperX.SuperSocket.Server.Command
{
    public class Receiving : CommandBase<IOTSocketSession, BinaryRequestInfo>
    {
        public override void ExecuteCommand(IOTSocketSession session, BinaryRequestInfo requestInfo)
        {
            var json = JsonHelper.TransferObjectJsonSerialize(new Mod() { ControllerName = "SuperSocket", ActionName = "GetServerUser", objects = new object[] { } });
            var msg = Encoding.UTF8.GetString(requestInfo.Body);
            Mod mod = JsonHelper.TransferObjectJsonDeserialize<Mod>(msg);
            session.Communication.Receiving(mod.ControllerName, mod.ActionName, mod.objects);
        }
    }

    public class Mod
    {
        public string ControllerName;
        public string ActionName;
        public object[] objects;
    }
}